/*
 * Copyright (C) 2016 yixun All Rights Reserved.
 * 
 * SalesStatusEnum.java
 */
package com.emm.yixun.common.model.enums;
import java.io.Serializable;
import org.apache.commons.lang.StringUtils;
/**
 * 房款类型
*/
public enum HousingFundTypeEnum implements Serializable{
	    FUNDTYPE_1("1","认筹金",null),
	    FUNDTYPE_2("2","退认筹金",null),
	    FUNDTYPE_3("3","认购金",null),
	    FUNDTYPE_4("4","退认购金",null),
	    FUNDTYPE_5("5","一次性全款",null),
	    FUNDTYPE_6("6","商业贷款首付款",null),
	    FUNDTYPE_7("7","商业贷款按揭款",null), 
	    FUNDTYPE_8("8","手续费",null),
	    FUNDTYPE_9("9","POS手续费",null), 
	    FUNDTYPE_10("10","公积金首付款",null),
	    FUNDTYPE_11("11","公积金按揭款",null), 
	    FUNDTYPE_12("12","分期一期款",null),
	    FUNDTYPE_13("13","分期二期款",null),
	    FUNDTYPE_14("14","分期三期款",null),
	    FUNDTYPE_15("15","分期四期款",null), 
	    FUNDTYPE_16("16","分期五期款",null),
	    FUNDTYPE_17("17","组合贷款首付款",null),
	    FUNDTYPE_18("18","组合贷款银行按揭",null),
	    FUNDTYPE_19("19","组合贷款公积金按揭",null),
	    FUNDTYPE_20("20","签约金",null),    
	    FUNDTYPE_21("21","退签约金",null),
	    FUNDTYPE_22("22","--",null),
	    FUNDTYPE_23("23","补差款",null),
	    FUNDTYPE_24("24","退手续费",null),
	    FUNDTYPE_25("25","收认购合同金",null),
	    FUNDTYPE_26("26","一次性全款(首付分期)",null),
	    FUNDTYPE_27("27","商业贷款首付款(首付分期)",null),
	    FUNDTYPE_28("28","商业贷款按揭款(首付分期)",null),
	    FUNDTYPE_29("29","分期一期款(首付分期)",null),
	    FUNDTYPE_30("30","分期二期款(首付分期)",null),
	    FUNDTYPE_31("31","分期三期款(首付分期)",null),
	    FUNDTYPE_32("32","分期四期款(首付分期)",null), 
	    FUNDTYPE_33("33","分期五期款(首付分期)",null),
		FUNDTYPE_34("34","退首付分期",null),
		FUNDTYPE_35("35","车位首付款",null),
		FUNDTYPE_36("36","车位银行按揭",null),
		FUNDTYPE_37("37","车位公积金",null),
		FUNDTYPE_38("38","分期一期款(车位)",null),
		FUNDTYPE_39("39","分期二期款(车位)",null),
		FUNDTYPE_40("40","分期三期款(车位)",null),
		FUNDTYPE_41("41","分期四期款(车位)",null),
		FUNDTYPE_42("42","分期五期款(车位)",null),
		FUNDTYPE_43("43","一次性全款(车位)",null),
		FUNDTYPE_44("44","现金折扣",null),
		FUNDTYPE_45("45","垫付首期",null);

		private final String no;
		private final String des;
		private final Enum parent;
		
		/**
		 * 私有构造函数
		 * @param code
		 * @param description
		 */
		HousingFundTypeEnum(String no, String des,Enum parent) {
			this.no = no;
			this.des = des;
			this.parent = parent;
		}

		/**
		 * @return Returns the no.
		 */
		public String getNo() {
			return no;
		}

		/**
		 * @return Returns the des.
		 */
		public String getDes() {
			return des;
		}
		
		/**
		 * @return Returns the parent.
		 */
		public Enum getParent() {
			return parent;
		}

		/**
		 * 通过枚举<code>des</code>获得枚举
		 * 
		 * @param des
		 * @return
		 */
		public static HousingFundTypeEnum getByDescription(String des) {
			if(StringUtils.isBlank(des)){
				return null;
			}
			for (HousingFundTypeEnum menum : values()) {
				if (menum.getDes().equals(des)) {
					return menum;
				}
			}
			return null;
		}
		public static HousingFundTypeEnum getByNo(String no) {
			if(StringUtils.isBlank(no)){
				return null;
			}
			for (HousingFundTypeEnum menum : values()) {
				if (menum.getNo().equals(no)) {
					return menum;
				}
			}
			return null;
		}
}
